package org.hfy.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.hfy.dto.OptionDTO;
import org.hfy.dto.OutsourcingQueryDTO;
import org.hfy.entity.Outsourcing;
import org.hfy.entity.Quotation;

import java.time.LocalDate;
import java.util.List;

/**
 * 外发加工服务接口
 * 
 * @author hfy
 * @version 1.0
 */
public interface OutsourcingService extends IService<Outsourcing> {

    /**
     * 分页查询外发加工列表
     */
    IPage<Outsourcing> getOutsourcingPage(OutsourcingQueryDTO query);

    /**
     * 根据ID查询外发加工详情（包含报价单和明细信息）
     */
    Outsourcing getOutsourcingWithDetailsById(Long id);

    /**
     * 创建外发单
     */
    Outsourcing createOutsourcing(Outsourcing outsourcing);

    /**
     * 更新外发状态
     */
    boolean updateOutsourcingStatus(Long id, String status, LocalDate actualReturnDate);

    /**
     * 删除外发单
     */
    boolean deleteOutsourcing(Long id);

    /**
     * 获取供应商选项列表
     */
    List<OptionDTO> getSupplierOptions();

    /**
     * 生成外发单号
     */
    String generateOutsourcingNo();

    /**
     * 获取可用于外发加工的报价记录列表
     * 包括状态为"合同审核通过"和"外发加工中"的报价单
     */
    List<Quotation> getAvailableQuotationsForOutsourcing();
} 